var tabArray = new Array();
chrome.tabs.query({}, function (tabs) {
	for (var i = 0; i < tabs.length; i++) {
        tabArray[i] = tabs[i];
    }
    for (var i = 0; i < tabArray.length; i++) {
        if (tabArray[i] != null){
		   var tab = chrome.contextMenus.create({"title": tabArray[i].title, "id": tabArray[i].id+"",  "onclick": genericOnClick});
		   }
        }
    });
function genericOnClick(info, tab) {
  var move = chrome.tabs.update(parseInt(info.menuItemId), {active: true});
}